﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.DynamicData;

namespace NotAClue.ComponentModel.DataAnnotations
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class ColumnReadOnlyInAttribute : Attribute
    {
        /// <summary>
        /// Gets or sets the page template.
        /// </summary>
        /// <value>The page template.</value>
        public PageTemplate PageTemplate { get; private set; }

        /// <summary>
        /// Gets or sets the disabled CSS class.
        /// </summary>
        /// <value>The disabled CSS class.</value>
        public String DisabledCssClass { get; set; }

        public ColumnReadOnlyInAttribute() { }

        public ColumnReadOnlyInAttribute(PageTemplate pageTemplate)
        {
            PageTemplate = pageTemplate;
            DisabledCssClass = DisabledCssClass ?? "disabled";
        }
    }
}